package 勤工俭学;

public class Prize {
	public static double sum1(double number1, double number2) throws Exception{
		if (number1 < 0 || number2 < 0) {
			throw new Exception("不可以为负数");
		}else {
		return (number1 + number2);
		}
	}
	public static double sum(double number1, double number2) throws Exception{
		return sum1( number1,  number2);
	}

	public final static int x = 5000;//税收标准一档
	public final static int y = 10000;//税收标准二档

	public static double avg(double num)  {

		if (num > y) {
			num = num * 0.9;//收入达到税收标准二挡
		}
			
		if (num > x) {
			num = num * 0.95;//收入达到税收标准一档
		}
		
		if (num < x) {
			System.out.println("不需要交税");//收入不到税收标准
		}
		return num;
	}
}

